/**
 * Created by Apple on 2017/7/20.
 */


$(function () {
    event("#div1");
    event("#div2");
    function event(id) {
        $(id + " button").click(function () {
            $(id + " .ul").slideDown()
        })
        $(id + " li").click(function () {
            console.log("12sssss")
            var str = $(this).html();
            var msg = "";
            for (var i = 0; i < str.length; i++) {
                if (Boolean(Number(str[i])) == false) {
                    if (str[i] != "0") {
                        msg += str[i]
                    }
                }
            }
            $(id + " .ul").hide();
            $(id + " input[type=text]").val(parseInt(str));
            $(id + ".inp_right").html(msg)

        })

    }

})
